#light

module Dwarf_SpectralMethod_Generator

open System
open System.IO
open System.Text
open System.ComponentModel

let Dwarf_SpectralMethod_Generator (fs : FileStream, args : String[]) = 

    let sw = new StreamWriter(fs);
    let rand = new Random();
    
    
    let size = (int) args.[args.Length - 1];
    // Write length of matrix.
    sw.WriteLine(size);
    
    // Write Matrix row by row, each element is complex number, real and image separated by " " simbol,
    // each complex number separated by ";" simbol.
    for i = 0 to size - 1 do
        for j = 0 to size - 1 do
           do sw.Write(rand.Next(0,20)); 
           do sw.Write(" ");
           do sw.Write(rand.Next(0,20));
           if ( j <> (size - 1))then sw.Write(";");
        if (i <> (size - 1)) then sw.WriteLine();
        
    sw.Close();
    true
    
